package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.AgentInfo;
import cc.rengu.redp.bizimpl.upmp.vo.OperationResult;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
* @author 刘玉亮.LL
*/
    public interface IAgentInfoService extends IService<AgentInfo> {

    IPage<AgentInfo> findByPage(QueryRequest request, AgentInfo entity);


    Map<String, Object> orgExpandSelect2List(String q);

    Map<String, Object> editShow(AgentInfo entity, String optFlag) throws RedpException;

    OperationResult saveData(String menuId, String oprMenuName, AgentInfo entity, HttpServletRequest request, String webNextUrl) throws RedpException;

    @Transactional(value = "transactionManager")
    OperationResult chkData(String menuId, String oprMenuName, AgentInfo entity, HttpServletRequest request, String webNextUrl) throws RedpException;

    @Transactional
    void delete(String[] ids);

    Map<String, Object> agentCdSelect2List(QueryRequest request, String q);

    AgentInfo findOneByAgentCode(String agentCode, String instId);

    AgentInfo findOneByCode(String agentMchntNo, String status, String instId);

    AgentInfo findOneByCodeAndCrtOrg(String agentMchntNo, String status, List<String> orgList);
}
